#ifndef GAMEENTITY_HEADER
#define GAMEENTITY_HEADER

#include <vector>

#include "Serializable.h"
#include "Updatable.h"
#include "Drawable.h"

#include "../../Dependencies.h"

class SceneNode;

class GameEntity : public Serializable, public Updatable, public Drawable {
public:
	GameEntity(int, std::string);					//Constructor with frequency to initialize updatable 
													//and String to initialize name of the Game Entity
	virtual ~GameEntity();							//Destructor

	std::string getName() const;					//Returns the Name of the Game Entity

	virtual void reset() = 0;						//From Serializable to be implemented in the Game Entity itself
	virtual bool write(std::ostream&);				//From Serializable
	virtual void read(std::istream&);				//From Serializable

	virtual void actualUpdate(unsigned long long timePassed) = 0;	//From Updatable to be implemented in the Game Entity itself

	virtual void draw()=0;							//From Drawable to be implemented in the Game Entity itself

	POINT3D getPosition() const;					//Get the position of the entity
	void setPosition(POINT3D);						//Set the position of the entity, but also of all the connected entities
	
	ORIENTATION getOrientation() const;				//Get the position of the entity
	void setOrientation(ORIENTATION);				//Set the orientation of the entity, but also of all the connected entities


	SceneNode* getMySceneNode() const ;				//Returns the SceneNode of the Game Entity
	void setMySceneNode(SceneNode*);				//Sets the Game Entity's reference to the SceneNode

	void* QueryInterface(InterfaceID);				//check if it is serializable and drawable etc.. 
													//according to the InterfaceID in Dependencies class
	
	void setColor(COLOR);

	COLOR getColor();
	
	virtual int getType() = 0;

	void destroy();
	bool toDestroy();

private:
	std::string _name;								//Name of the Game Entity
	SceneNode* mySceneNode;							//To keep reference to the SceneNode that the Game Entity is attached
	COLOR _color;
	bool _destroy;
};

#endif